package com.stu.controller.student;

import com.stu.Dto.ClassJobApplicationDTO;
import com.stu.Dto.StayApplicationDTO;
import com.stu.pojo.StayApplication;
import com.stu.result.Result;
import com.stu.serive.ClassInformationService;
import com.stu.serive.StayApplicationService;
import com.stu.vo.StayApplicationVo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@Slf4j
@RestController
@RequestMapping("/student")
public class StayApplicationController {

    @Autowired
    private StayApplicationService stayApplicationService;

    /**
     * 添加学生申请留校
     * @return
     */
    @PostMapping("/stayApplication")
    public Result insertStayApplicationApplication(@RequestBody StayApplicationDTO stayApplicationDTO){
        stayApplicationService.insertStayApplication(stayApplicationDTO);
        return Result.success();
    }

    /**
     * 查询留校申请进度
     * @return
     */
    @GetMapping("/stayApplication")
    private Result<List<StayApplicationVo>> selectStayApplication(){
        return Result.success(stayApplicationService.selectStayApplication());
    }

}
